package edu.must.uh.impl;

import java.util.Map;

import edu.must.uh.bean.DeployQueryResultBean;
import edu.must.uh.util.PageHelper;
import edu.must.uh.util.SqlUtils;
import edu.must.uh.util.Tools;
import edu.must.uh.util.ToolsOfString;

public class UserImpl extends BaseImpl {

    public UserImpl() {
         super.cashkey     = "base_user";
         super.cashListkey = "base_user";
         super.keyFields   = "UserId";
         super.tableName   = "base_user"; 
    }
    
    public  DeployQueryResultBean getLimitlist(Map<String, Object> searchcondition,
            String sqlcondition) throws Exception {        
           
            String sqlString = "SELECT SQL_CALC_FOUND_ROWS UserId, Account,RealName,Gender,Mobile,Email,DepartmentId,RoleId,DutyId,PostId,RFullName,DRFullName,PRFullName,DFullName,SortCode FROM v_base_user Where DeleteMark= 0  ";
            sqlString = sqlString + Tools.getSQLCondition(searchcondition);
            sqlString = sqlString +ToolsOfString.NulltoEmpty(sqlcondition) ;     
            sqlString = sqlString + PageHelper.getLimit(_PageBean);
            DeployQueryResultBean resList = SqlUtils.getMySqlInstance().getLimitlist(sqlString);
            return resList;
        }
    
}
